package com.gyh.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.net.URL;

@RestController
public class TestController {
    @Value("${db.url}")
    private String url;
    @Value("${db.user}")
    private String user;
    @Value("${db.password}")
    private String password;
    @GetMapping("/test")
    public String test(){
        String str="<h1>当前环境连接的数据库URL:"+ url +"</h1>";
        str+="<h1>数据库用户:"+ user +"</h1>";
        str+="<h1>数据库密码:"+ password +"</h1>";
        return str;
    }
}
